<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<!--<meta name='apple-itunes-app' content='app-id=994088724'>-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

 <a href="https://itunes.apple.com/cn/app/id994088724" id="openApp">open</a>
<script type="text/javascript">
    document.getElementById('openApp').onclick = function(e){
        // 通过iframe的方式试图打开APP，如果能正常打开，会直接切换到APP，并自动阻止a标签的默认行为
        // 否则打开a标签的href链接
        var ifr = document.createElement('iframe');
        ifr.src = 'hme://';
        ifr.style.display = 'block';
        document.body.appendChild(ifr);
        window.setTimeout(function(){
            document.body.removeChild(ifr);
        },3000)
    };
</script>  
	
</body>
</html>